<?php
session_start();
$id_user=$_SESSION['ID_user'];
$_SESSION['username'];
include "config/identitas-situs.php";
include "config/koneksi.php";
include "config/tanggalan.php";
include "config/library.php";

$pendaftar=mysql_fetch_array(mysql_query("select * from tb_pendaftar  where no_pendaftaran ='$id_user'"));
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>
Nilai Calon Siswa &laquo; <?php echo $title; ?>
</title>

<link rel="shortcut icon" href="images/icon.ico" />
<link href="config/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<style>
input.error, textarea.error, select.error {
	background-color:#FFFFCC !important;
	border:1px solid #CC0000 !important;
}
label.error {
	color:#CC0000 !important;
	font-family:Arial, Helvetica, sans-serif !important;
	font-size:11px !important;
	padding-left:5px !important;
}
</style>
</head>
<body>
 <div id="lebar-web">
	<div id="header">
		<div class="header-judul"><?php echo $namasitus; ?></div>
		<div class="header-deskripsi"><?php echo $deskripsi; ?></div>
	</div>
	 <ul id="menu_nav" class="Blue">
		<li class="button"><a href="index.php">Beranda</a></li>
		<li class="button"><a href="berita.php">Informasi PPDB</a></li>
		<li class="button"><a href="profil.php">Profil Sekolah</a></li>
		<li class="button"><a href="daftar.php">Pendaftaran</a></li>
        <li class="button"><a href="jurusan.php">Program Keahlian</a></li>
		
        <li class="button"><a href="login.php">Masuk</a></li>		
	 </ul>
  <div id="isi">

<H1>Nilai Calon Siswa </H1>
<form name="formdaftar" action="daftar.php?aksi=registrasi" method="post" id="form_daftar">
  <table id="belang">
  <tr>
  	<th>Nama</th>
	<td><input type="text" name="nama" size="50" value="<? echo $pendaftar['nama'] ?>" class="required" /></td>
  </tr>
 
  <tr>
  	<th>Program Keahlian</th>
	    <td>
        <? $proli=mysql_query("SELECT * FROM tb_proli WHERE kd_proli = '$pendaftar[proli]'");
	$k=mysql_fetch_array($proli);?>
	<input type="text" id="proli" name="proli" size="50"value="<? echo $k[proli];?>" />  </td>
  </tr>
   <td>
            <? $nilai=mysql_query("SELECT * FROM tb_nilai WHERE no_pendaftaran = '$nama[no_pendaftaran]'");
		$n=mysql_fetch_array($nilai);?>             
            </td>
  <tr>
  	<th>Nilai Matematika</th>
	<td><input type="text" name="matematika" size="50" value="<? echo $n['matematika'] ?>" class="required" /></td>
  </tr>
   <tr>
  	<th>Nilai Bhs.Indonesia</th>
	<td><input type="text" name="indonesia" size="50" value="<? echo $n['indonesia'] ?>" class="required" /></td>
  </tr>
  <tr>
  	<th>Nilai Bhs.Inggris</th>
	<td><input type="text" name="inggris" size="50" value="<? echo $n['ingris'] ?>" class="required" /></td>
  </tr>
  <tr>
  	<th>Nilai IPA</th>
	<td><input type="text" name="ipa" size="50" value="<? echo $n['ipa'] ?>" class="required" /></td>
  </tr>
   <?php 
				$jum=mysql_query("select matematika,indonesia,inggris,ipa, (matematika+indonesia+inggris+ipa) AS jumlah FROM tb_nilai WHERE no_pendaftaran = '$no_pendaftaran[no_pendaftaran]'");
		$j=mysql_fetch_array($jum); ?>
 <tr>
  	<th>Jumlah</th>
	<td><input type="text" name="jumlah" size="50" value="<? echo $j['JUM'] ?>" class="required" /></td>
  </tr>
               <?php
			   if ($n[status]=='1')
			   
			   {
			   $status="terima";}
			   else {
				$status="tidak terima";}
				?>
   <tr>
<th>Status</th>
  <td><input type="text" name="status" size="50" value="<? echo $status ?>" class="required" /></td>
  </tr>
</table>
</form>
<?php
?>
 </div>
 	<div style="clear:both" />
 	<div id="footer" align="center"><?php echo $namasitus; ?> <br><br>&copy; 2014. Copyrigt by: <a href="author.php">Lulu Infajaroh</a>
	<a href="#header" title="Kembali ke Atas"><img src="images/go-top.png" style="float:right; width:15px; height:15px;" /></a></div>
 </div>
 <script type="text/javascript">
$(document).ready(function(){
	$("#form_daftar").validate();
});
</script>
</body>
</html>